<h1>Edit Users</h1>
<br/>
<table class="form"> 
	
  <tr>
    <th>Full Name</th>
    <th>Email</th>
	<th>Observations</th>
    <th>Active</th>
    <th colspan="3">Actions</th>    
  </tr>
  
<% for user in @users 
    entry_count=user.entries.count%>
  <tr>
    <td><%=h user.fullname %></td>
    <td><%=h user.email %></td>
    <td><%=h entry_count %></td>
    <td><%=h user.active %></td>
    <td><%= link_to 'View', :action => 'show_user', :id => user %></td>
    <td><%= link_to 'Edit', :action => 'edit_user', :id => user %></td>
    <td><%if entry_count==0 && $MAGIC_USERS.include?(user.email)==false%><%= link_to 'Delete', { :action => 'destroy_user', :id => user }, :confirm => 'Are you sure?', :post => true %><%else%>&nbsp;<%end%></td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @user_pages.current.previous } if @user_pages.current.previous %>
<%= link_to 'Next page', { :page => @user_pages.current.next } if @user_pages.current.next %> 

<br />

